//获取ID
function $id(id){
    return document.getElementById(id);
    }
function ShowUpDiv(){
    document.writeln("<div id=\"msgdiv\" style=\"position:absolute;display:none;border:2px solid #D0D0D0;\"><\/div>");
    document.writeln("<div id=\"overdiv\" style=\"position:absolute;display:none;\">");
    document.writeln("<\/div>");
    this.msgobjname=""
    this.show=function(iframesrc){
        var tempobj1=$id("msgdiv");
        var tempobj2=$id("overdiv");
        var msgobj=this.msgobjname;
          tempobj2.style.filter="alpha(opacity=10)";
          tempobj2.style.MozOpacity = 90/100;
        tempobj2.style.backgroundColor = "#000000";
         tempobj2.style.display = '';
        tempobj2.style.zIndex= 100;
        tempobj2.style.height= document.documentElement.clientHeight+"px";
        tempobj2.style.width= document.documentElement.clientWidth+"px";
            tempobj2.style.left=0;
            tempobj2.style.top=0;
            tempobj1.style.display="none";
        tempobj1.style.left= (document.documentElement.clientWidth)/3+"px";
        tempobj1.style.top= (document.documentElement.scrollTop+(document.documentElement.clientHeight)/4-50)+"px";
        tempobj1.style.display= '';
        tempobj1.style.width=500+"px";
        tempobj1.style.height=360+"px";
        tempobj1.style.zIndex= 200;
        tempobj1.style.backgroundColor = "#F6F6F6";
        var OutStr;

		OutStr='<div style="width:500px;height:26px;background-color:#DFDFDF;" ><div  style="font-weight:bolder;text-align:center;float:left;padding-top:3px;width:465px;height:26px;font-size:14px;cursor:move" canmove="true" forid="msgdiv" >上传文件1</div><div style="text-align:center;float:right;padding-top:5px;width:30px;font-size:12px;cursor:hand" onclick="'+msgobj+'.hide()">关闭</div></div>'
        OutStr=OutStr+"<div style=\"height:334px;width:480px;word-wrap:break-word;margin-left:auto;margin-right:auto; font-size:12px;\"><iframe src='"+iframesrc+"'></iframe></div>"

        tempobj1.innerHTML=OutStr;
        var md=false,mobj,ox,oy
        document.onmousedown=function(ev)
        {
            var ev=ev||window.event;
            var evt=ev.srcElement||ev.target;
            if(typeof(evt.getAttribute("canmove"))=="undefined")
            {
                 return;
            }
            if(evt.getAttribute("canmove"))
            {
                md = true;
                mobj = document.getElementById(evt.getAttribute("forid"));
                ox = mobj.offsetLeft - ev.clientX;
                oy = mobj.offsetTop - ev.clientY;
            }
        }
        document.onmouseup= function(){md=false;}
        document.onmousemove= function(ev)
        {
            var ev=ev||window.event;
            if(md)
            {
                mobj.style.left= (ev.clientX + ox)+"px";
                mobj.style.top= (ev.clientY + oy)+"px";
            }
        }
        }

		this.hide=function(){			
            $id('msgdiv').style.display='none';
            $id('overdiv').style.display='none';
        }
    }

var UpDiv=new ShowUpDiv();
//设置对象名,供内部引用
UpDiv.msgobjname="UpDiv";